cmake_minimum_required(VERSION 3.20)

project(
  mega128_modpash
  VERSION 1.0
  DESCRIPTION "MODPASH MEGA 128"
  LANGUAGES CXX)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_STANDARD 20)

set(HOME_DIR $ENV{USERPROFILE})

set(ARDUINO_CORE
    "${HOME_DIR}/.platformio/packages/framework-arduino-avr-megacore")

include_directories(
  lib/data_basic
  lib/ioxx
  lib/modpash
  lib/scheduler_basic
  "${ARDUINO_CORE}/cores/MegaCore"
  "${ARDUINO_CORE}/libraries/SPI/src"
  "${ARDUINO_CORE}/libraries/Wire/src"
  "${HOME_DIR}/.platformio/packages/toolchain-atmelavr/avr/include")

add_compile_definitions(LED_BUILTIN=16)

message("Home: ${HOME_DIR}")

# ####################################################s##########################
# TARGET: modpash
# ##############################################################################

add_executable(modpash src/main.cpp)

target_compile_definitions(modpash PUBLIC F_CPU=12000000)

set_property(TARGET modpash PROPERTY CXX_STANDARD 20)
